// Copyright 2012 Google Inc. All Rights Reserved.

package com.google.appengine.preferencessync.internal;

import com.google.appengine.syncserver.shared.PropertyChange;

import java.util.ArrayList;
import java.util.Collections;

/**
 * Paging class for responses from the server.
 */
public class ResponsePaging {
  // List of property changes.
  private final ArrayList<PropertyChange> propertyChangeList;

  /**
   * Constructor for this class.
   */
  public ResponsePaging() {
    this.propertyChangeList = new ArrayList<PropertyChange>();
  }

  /**
   * Add property changes to the change list in the class.
   *
   * @param changes List of changes to be added to this class.
   */
  public void addChanges(PropertyChange[] changes) {
    Collections.addAll(propertyChangeList, changes);
  }

  /**
   * Get all the changes this class is storing.
   *
   * @return the list of changes this class is storing.
   */
  public ArrayList<PropertyChange> getAllChanges() {
    return propertyChangeList;
  }
}
